package com.darwin.darwinDll.analyze
{
	import com.darwin.darwinDll.core.DllItem;
	
	import flash.utils.ByteArray;
	import flash.utils.Dictionary;
	
	/**
	 * 二进制文件解析器
	 * @author Roland
	 */
	public class BinAnalyze implements IAnalyze
	{
		public function BinAnalyze()
		{
		}
		
		private var _binList:Dictionary = new Dictionary();
		public function analyze(byteArray:ByteArray, dllItem:DllItem, compFn:Function):void
		{
			dllItem.data = byteArray;
			dllItem.result = byteArray;
			dllItem.status = DllItem.STATUS_LOADED;
			_binList[dllItem.name] = byteArray;
			if(compFn!=null)
			{
				compFn(dllItem);
			}
		}
		
		public function getDataList():Dictionary
		{
			return _binList;
		}
		
		
		/**
		 *	二进制数据 
		 * @param key 文件名
		 * @param subKey 二级键值（此处忽略）
		 * @return 
		 * 
		 */
		public function getData(key:String, subKey:String):*
		{
			return _binList[key];
		}
	}
}